package com.longai.model;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

/**
 * Newslike entity. @author MyEclipse Persistence Tools
 */
@Entity
@Table(name = "newslike", catalog = "longai")
public class Newslike implements java.io.Serializable {

	// Fields

	private Integer newslikeId;
	private News news;
	private User user;
	private Long newslikePubtime;

	// Constructors

	/** default constructor */
	public Newslike() {
	}


	// Property accessors
	@Id
	@GeneratedValue
	@Column(name = "newslike_id", unique = true, nullable = false)
	public Integer getNewslikeId() {
		return this.newslikeId;
	}

	public void setNewslikeId(Integer newslikeId) {
		this.newslikeId = newslikeId;
	}

	@ManyToOne(fetch = FetchType.EAGER)
	@JoinColumn(name = "news_id")
	public News getNews() {
		return this.news;
	}

	public void setNews(News news) {
		this.news = news;
	}
	@ManyToOne(fetch = FetchType.EAGER)
	@JoinColumn(name = "user_id")
	public User getUser() {
		return this.user;
	}

	public void setUser(User user) {
		this.user = user;
	}

	@Column(name = "newslike_pubtime")
	public Long getNewslikePubtime() {
		return this.newslikePubtime;
	}

	public void setNewslikePubtime(Long newslikePubtime) {
		this.newslikePubtime = newslikePubtime;
	}

}